Excel Number Format

Use the FormatString property to control how numeric values are displayed in any Excel Cell or Range with IronXL for Python.

Using worksheet["A2"] selects the Range for the specified address. To access an individual Cell, the First() method can be used. However, the FormatString property can be set directly on both a Cell and a Range, so First() can often be omitted. Additional number formats can be applied using the same approach, as demonstrated in the code example below.

In the code example, the WorkBook.Load method opens an existing Excel file. The worksheet["A2"] syntax selects a specific cell, and the FormatString property is set to "0.00" to display the value with two decimal places. Finally, SaveAs saves the modified workbook to a new file.

Learn to Set Excel Cell Data Formats with Python.

Ready to Get Started?
Version: 2026.4 just released
Still Scrolling Icon

Still Scrolling?

Want proof fast?
run a sample watch your data become a spreadsheet.